<!doctype html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>营业证件_店铺管理|速定客_预订美好生活！</title>
<meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible">
<meta content="外卖信息,中山外卖送餐,网上订餐,-,,速定客,速订客，预订美好生活！外卖订餐美食网" name="keywords">
<meta content="速订客—外卖网，订餐，美食。最好的网上订餐平台，为您提供最新最全的24小时外卖送餐电话、外卖菜单等外卖订餐详细信息。包括肯德基网上订餐电话，麦当劳网上订餐电话。" name="description">
<link rel="stylesheet" type="text/css" href="http://img2.sudingke.com/css/base.css">
<link rel="stylesheet" type="text/css" href="http://img.sudingke.net/css/member/global.css">
<link rel="stylesheet" type="text/css" href="http://img.sudingke.net/css/member/member.css">
<link href="http://img2.sudingke.com/favicon.ico" type="image/x-icon" rel="icon" />
<link href="http://img2.sudingke.com/favicon.ico" type="image/x-icon" rel="shortcut icon" />
<body>
<!-- header start -->
<?php include $this->tpl('c_header'); ?>
<!-- header close -->

<div class="clearfix" id="bd">
  <div id="yao-main">
    <div class="yao-b">
      <?php include $this->tpl('c_news'); ?>
      <div class="mod mod-title" id="ucInfo">
        <form action="?m=biz&c=license&a=save" id="aform" method="post" autocomplete="off">
          <div class="hd">
            <h2>营业证件</h2>
          </div>
          <div class="bd">
            <div class="info-read">请上传正规的营业证件，方便我们进行商家审核；审核通过的商户可以在首页展现。</div>
            <table cellspacing="0" cellpadding="0" border="0" class="table-two">
              <tbody>
                <tr>
                  <th>&nbsp;</th>
                  <td><img src="http://member.qgwmw.com/upload/nopic.jpg" id="verify_pic" height="225" /></td>
                </tr
                <tr>
                  <th><span class="required">*</span>上传证件：</th>
                  <td><input type="hidden" name="verify_image" id="verify_image" required />
                    <button id="uploadPic" type="button"> 上传证件照片 </button>
                    <span class="v-tips">可以扫描或者用数码相机拍摄，2M 以内彩色</span></td>
                </tr>
                <tr>
                  <th><span class="required">*</span>证件类型：</th>
                  <td>
                    <select name="verify_type" id="verify_type">
                        <option value="">--请选择--</option>
                        <option value="营业执照">营业执照</option>
                        <option value="卫生许可证">卫生许可证</option>
                        <option value="身份证">身份证</option>
                        <option value="其它">其它证件</option>
                    </select>
                    <input type="text" minlength="3" required class="input-s" id="verify_name" name="verify_name" value="<?=h($data['verify_name']);?>" style="display:none;" />
                    <span class="v-tips"></span></td>
                </tr>
                <tr>
                  <th><span class="required">*</span>证件编号：</th>
                  <td><input type="text" minlength="4" required class="input-s" id="verify_code" name="verify_code" value="<?=h($data['verify_code']);?>" /></td>
                </tr>
                <tr class="table-ft">
                  <th>&nbsp;</th>
                  <td><div class="ucinfo-row"> <span class="btni04 submit"> <span>
                      <input type="hidden" name="submitform" value="yes">
                      <input type="submit" class=" js-log" hidefocus="true" value="保 存">
                      </span> </span>
                    </div></td>
                </tr>
              </tbody>
            </table>
          </div>
        </form>
        <div>&nbsp;</div>
      </div>
    </div>
  </div>
  <?php include $this->tpl('c_menunav'); ?>
</div>

<!-- footer start -->
<?php include $this->tpl('c_footer'); ?>
<!-- footer close -->

<script src="http://autocar.com/statics/js/jquery.js" language="JavaScript"></script>
<script src="http://autocar.com/statics/js/supe.js" language="JavaScript"></script>
<script type="text/javascript">
$(function(){
    $("#verify_type").change(function(){
        var value = this.options[this.selectedIndex].value;
        var span  = $(this).parent().find('span[for="verify_name"]');
        if(value == "其它"){
            $("#verify_name").val("").show();
            span.html("请填写证件类别").removeClass("v-valid").addClass("v-tips v-error");
        }else if(value == ""){
            $("#verify_name").val("").hide();
            span.html("请选择证件类别").removeClass("v-valid").addClass("v-tips v-error");
        }else{
            $("#verify_name").val(value).hide();
            span.html("&nbsp;").removeClass("v-error").addClass("v-tips v-valid");
        }
    });

    //上传图片
    $("#uploadPic").click(function(){
      var upbuttn = this;
      Supe.use('ajaxUpload', function(){
        new AjaxUpload(upbuttn, {
            action: "?m=system&c=upload&a=image",
            name: 'imagedata',
            onSubmit: function (file, ext) {
                if (!(ext && /^(jpg|png|jpeg|gif)$/.test(ext))) {
                    $(upbuttn).parent().find(".v-tips").addClass("v-error").html("仅支持 JPG, PNG 或 GIF 类型");
                    return false;
                }
                $(upbuttn).parent().find(".v-tips").html("正在上传中...");
            },
            onComplete: function (file, response) {
                var data = JSON.parse(response);
                if (data.err === "") {
                    $("#verify_image").val(data.msg.url);
                    $("#verify_pic").attr("src", "/upfiles/" + data.msg.url);
                    $(upbuttn).parent().find(".v-tips").addClass("v-valid").html("&nbsp;");
                } else {
                    $(upbuttn).parent().find(".v-tips").addClass("v-error").html(data.err);
                }
            }
        });
     });
   });
});
</script>
<script type="text/javascript">
//表单验证
var formSubmit = function(form){
  Supe.use('ajaxForm', 'dialog', function(){
    $(form).ajaxSubmit({
        url: $(this).attr("action"),
        type : "POST",
        dataType : "json",
        success : function(data) {
            if(!data.status){
                $.dialog.alert(data.error);
            }else{
                $.dialog.alert("信息修改成功！");
            }
        }
    });
  });
};
$(function(){
  Supe.use('validate', function(){
    $("#aform").validate({
        errorClass:'v-error',
        validClass:'v-valid',
        errorElement: 'span',
        ignore: '',
        errorPlacement:function(label, element){
            if(element.parent().find('.v-tips'))
                element.parent().find('.v-tips').remove();

            element.parent().append(label);
        },
        success: function(label, element) {
            // set &nbsp; as text for IE
            label.html("&nbsp;").addClass("v-valid");
        },
        submitHandler: function(form, e){
            e.preventDefault();
            formSubmit(form);
        },
        messages:{
            'verify_image' : {required: "请上传证件图片 2M 以内"},
            'verify_name'  : {required: "请填写证件类型", minlength: "请填写正确的证件名称"},
            'verify_code'  : {required: "请填写证件编号", minlength: "请填写正确的证件编号"}
        }
    });
  });
});
</script>
</body>
</html>
